home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / Lists.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  11.7 KB  |  410 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Lists.h
  3.  
  4.      Contains:    List Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __LISTS__
  19. #define __LISTS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __CONTROLS__
  25. #include <Controls.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50. typedef Point                             Cell;
  51. typedef Rect                             ListBounds;
  52. typedef char                             DataArray[32001];
  53. typedef char *                            DataPtr;
  54. typedef DataPtr *                        DataHandle;
  55. typedef CALLBACK_API( short , ListSearchProcPtr )(Ptr aPtr, Ptr bPtr, short aLen, short bLen);
  56. typedef CALLBACK_API( Boolean , ListClickLoopProcPtr )(void );
  57. /*
  58.     WARNING: ListClickLoopProcPtr uses register based parameters under classic 68k
  59.              and cannot be written in a high-level language without 
  60.              the help of mixed mode or assembly glue.
  61. */
  62. typedef STACK_UPP_TYPE(ListSearchProcPtr)                         ListSearchUPP;
  63. typedef REGISTER_UPP_TYPE(ListClickLoopProcPtr)                 ListClickLoopUPP;
  64. #if !TARGET_OS_MAC
  65. typedef long                             ListNotification;
  66.  
  67. enum {
  68.     listNotifyNothing            = FOUR_CHAR_CODE('nada'),        /* No (null) notification*/
  69.     listNotifyClick                = FOUR_CHAR_CODE('clik'),        /* Control was clicked*/
  70.     listNotifyDoubleClick        = FOUR_CHAR_CODE('dblc'),        /* Control was double-clicked*/
  71.     listNotifyPreClick            = FOUR_CHAR_CODE('pclk')        /* Control about to be clicked*/
  72. };
  73.  
  74. #endif  /*  !TARGET_OS_MAC */
  75.  
  76.  
  77.  
  78.  
  79. struct ListRec {
  80.     Rect                             rView;
  81.     GrafPtr                         port;
  82.     Point                             indent;
  83.     Point                             cellSize;
  84.     ListBounds                         visible;
  85.     ControlHandle                     vScroll;
  86.     ControlHandle                     hScroll;
  87.     SInt8                             selFlags;
  88.     Boolean                         lActive;
  89.     SInt8                             lReserved;
  90.     SInt8                             listFlags;
  91.     long                             clikTime;
  92.     Point                             clikLoc;
  93.     Point                             mouseLoc;
  94.     ListClickLoopUPP                 lClickLoop;
  95.     Cell                             lastClick;
  96.     long                             refCon;
  97.     Handle                             listDefProc;
  98.     Handle                             userHandle;
  99.     ListBounds                         dataBounds;
  100.     DataHandle                         cells;
  101.     short                             maxIndex;
  102.     short                             cellArray[1];
  103. };
  104. typedef struct ListRec                    ListRec;
  105.  
  106. typedef ListRec *                        ListPtr;
  107. typedef ListPtr *                        ListHandle;
  108. /* ListRef is obsolete.  Use ListHandle. */
  109. typedef ListHandle                         ListRef;
  110.  
  111.  
  112.  
  113. enum {
  114.     lDoVAutoscroll                = 2,
  115.     lDoHAutoscroll                = 1,
  116.     lOnlyOne                    = -128,
  117.     lExtendDrag                    = 64,
  118.     lNoDisjoint                    = 32,
  119.     lNoExtend                    = 16,
  120.     lNoRect                        = 8,
  121.     lUseSense                    = 4,
  122.     lNoNilHilite                = 2
  123. };
  124.  
  125.  
  126. enum {
  127.     lDoVAutoscrollBit            = 1,
  128.     lDoHAutoscrollBit            = 0,
  129.     lOnlyOneBit                    = 7,
  130.     lExtendDragBit                = 6,
  131.     lNoDisjointBit                = 5,
  132.     lNoExtendBit                = 4,
  133.     lNoRectBit                    = 3,
  134.     lUseSenseBit                = 2,
  135.     lNoNilHiliteBit                = 1
  136. };
  137.  
  138.  
  139.  
  140. enum {
  141.     lInitMsg                    = 0,
  142.     lDrawMsg                    = 1,
  143.     lHiliteMsg                    = 2,
  144.     lCloseMsg                    = 3
  145. };
  146.  
  147.  
  148. typedef CALLBACK_API( void , ListDefProcPtr )(short lMessage, Boolean lSelect, Rect *lRect, Cell lCell, short lDataOffset, short lDataLen, ListHandle lHandle);
  149. typedef STACK_UPP_TYPE(ListDefProcPtr)                             ListDefUPP;
  150. enum { uppListSearchProcInfo = 0x00002BE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 2_bytes, 2_bytes) */
  151. enum { uppListClickLoopProcInfo = 0x00000012 };                 /* register 1_byte:D0 Func() */
  152. enum { uppListDefProcInfo = 0x000EBD80 };                         /* pascal no_return_value Func(2_bytes, 1_byte, 4_bytes, 4_bytes, 2_bytes, 2_bytes, 4_bytes) */
  153. #define NewListSearchProc(userRoutine)                             (ListSearchUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppListSearchProcInfo, GetCurrentArchitecture())
  154. #define NewListClickLoopProc(userRoutine)                         (ListClickLoopUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppListClickLoopProcInfo, GetCurrentArchitecture())
  155. #define NewListDefProc(userRoutine)                             (ListDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppListDefProcInfo, GetCurrentArchitecture())
  156. #define CallListSearchProc(userRoutine, aPtr, bPtr, aLen, bLen)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppListSearchProcInfo, (aPtr), (bPtr), (aLen), (bLen))
  157. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  158.     #pragma parameter __D0 CallListClickLoopProc(__A0)
  159.     Boolean CallListClickLoopProc(ListClickLoopUPP routine) = 0x4E90;
  160. #else
  161.     #define CallListClickLoopProc(userRoutine)                     CALL_ZERO_PARAMETER_UPP((userRoutine), uppListClickLoopProcInfo)
  162. #endif
  163. #define CallListDefProc(userRoutine, lMessage, lSelect, lRect, lCell, lDataOffset, lDataLen, lHandle)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppListDefProcInfo, (lMessage), (lSelect), (lRect), (lCell), (lDataOffset), (lDataLen), (lHandle))
  164. #if !TARGET_OS_MAC
  165.  
  166. typedef void (*ListNotificationProcPtr)(ListHandle theList, ListNotification notification, long param);
  167. typedef ListNotificationProcPtr ListNotificationUPP;
  168. extern void LSetNotificationCallback (ListNotificationUPP callBack, ListRef lHandle);
  169.  
  170. #endif  /*  !TARGET_OS_MAC */
  171.  
  172.  
  173.  
  174. EXTERN_API( ListHandle )
  175. LNew                            (const Rect *            rView,
  176.                                  const ListBounds *        dataBounds,
  177.                                  Point                     cSize,
  178.                                  short                     theProc,
  179.                                  WindowPtr                 theWindow,
  180.                                  Boolean                 drawIt,
  181.                                  Boolean                 hasGrow,
  182.                                  Boolean                 scrollHoriz,
  183.                                  Boolean                 scrollVert)                            THREEWORDINLINE(0x3F3C, 0x0044, 0xA9E7);
  184.  
  185. EXTERN_API( void )
  186. LDispose                        (ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0028, 0xA9E7);
  187.  
  188. EXTERN_API( short )
  189. LAddColumn                        (short                     count,
  190.                                  short                     colNum,
  191.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0004, 0xA9E7);
  192.  
  193. EXTERN_API( short )
  194. LAddRow                            (short                     count,
  195.                                  short                     rowNum,
  196.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0008, 0xA9E7);
  197.  
  198. EXTERN_API( void )
  199. LDelColumn                        (short                     count,
  200.                                  short                     colNum,
  201.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0020, 0xA9E7);
  202.  
  203. EXTERN_API( void )
  204. LDelRow                            (short                     count,
  205.                                  short                     rowNum,
  206.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0024, 0xA9E7);
  207.  
  208. EXTERN_API( Boolean )
  209. LGetSelect                        (Boolean                 next,
  210.                                  Cell *                    theCell,
  211.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x003C, 0xA9E7);
  212.  
  213. EXTERN_API( Cell )
  214. LLastClick                        (ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0040, 0xA9E7);
  215.  
  216. EXTERN_API( Boolean )
  217. LNextCell                        (Boolean                 hNext,
  218.                                  Boolean                 vNext,
  219.                                  Cell *                    theCell,
  220.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0048, 0xA9E7);
  221.  
  222. EXTERN_API( Boolean )
  223. LSearch                            (const void *            dataPtr,
  224.                                  short                     dataLen,
  225.                                  ListSearchUPP             searchProc,
  226.                                  Cell *                    theCell,
  227.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0054, 0xA9E7);
  228.  
  229. EXTERN_API( void )
  230. LSize                            (short                     listWidth,
  231.                                  short                     listHeight,
  232.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0060, 0xA9E7);
  233.  
  234. EXTERN_API( void )
  235. LSetDrawingMode                    (Boolean                 drawIt,
  236.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x002C, 0xA9E7);
  237.  
  238. EXTERN_API( void )
  239. LScroll                            (short                     dCols,
  240.                                  short                     dRows,
  241.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0050, 0xA9E7);
  242.  
  243. EXTERN_API( void )
  244. LAutoScroll                        (ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0010, 0xA9E7);
  245.  
  246. EXTERN_API( void )
  247. LUpdate                            (RgnHandle                 theRgn,
  248.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0064, 0xA9E7);
  249.  
  250. EXTERN_API( void )
  251. LActivate                        (Boolean                 act,
  252.                                  ListHandle             lHandle)                            TWOWORDINLINE(0x4267, 0xA9E7);
  253.  
  254. EXTERN_API( void )
  255. LCellSize                        (Point                     cSize,
  256.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0014, 0xA9E7);
  257.  
  258. EXTERN_API( Boolean )
  259. LClick                            (Point                     pt,
  260.                                  short                     modifiers,
  261.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0018, 0xA9E7);
  262.  
  263. EXTERN_API( void )
  264. LAddToCell                        (const void *            dataPtr,
  265.                                  short                     dataLen,
  266.                                  Cell                     theCell,
  267.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x000C, 0xA9E7);
  268.  
  269. EXTERN_API( void )
  270. LClrCell                        (Cell                     theCell,
  271.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x001C, 0xA9E7);
  272.  
  273. EXTERN_API( void )
  274. LGetCell                        (void *                    dataPtr,
  275.                                  short *                dataLen,
  276.                                  Cell                     theCell,
  277.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0038, 0xA9E7);
  278.  
  279. EXTERN_API( void )
  280. LRect                            (Rect *                    cellRect,
  281.                                  Cell                     theCell,
  282.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x004C, 0xA9E7);
  283.  
  284. EXTERN_API( void )
  285. LSetCell                        (const void *            dataPtr,
  286.                                  short                     dataLen,
  287.                                  Cell                     theCell,
  288.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0058, 0xA9E7);
  289.  
  290. EXTERN_API( void )
  291. LSetSelect                        (Boolean                 setIt,
  292.                                  Cell                     theCell,
  293.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x005C, 0xA9E7);
  294.  
  295. EXTERN_API( void )
  296. LDraw                            (Cell                     theCell,
  297.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0030, 0xA9E7);
  298.  
  299.  
  300. EXTERN_API( void )
  301. LGetCellDataLocation            (short *                offset,
  302.                                  short *                len,
  303.                                  Cell                     theCell,
  304.                                  ListHandle             lHandle)                            THREEWORDINLINE(0x3F3C, 0x0034, 0xA9E7);
  305.  
  306. #if !TARGET_OS_MAC
  307. EXTERN_API_C( void )
  308. LSetLDEF                        (ListDefUPP             proc,
  309.                                  ListRef                 lHandle);
  310.  
  311. #endif  /*  !TARGET_OS_MAC */
  312.  
  313.  
  314. #if CGLUESUPPORTED
  315. EXTERN_API_C( void )
  316. laddtocell                        (const void *            dataPtr,
  317.                                  short                     dataLen,
  318.                                  const Cell *            theCell,
  319.                                  ListHandle             lHandle);
  320.  
  321. EXTERN_API_C( void )
  322. lclrcell                        (const Cell *            theCell,
  323.                                  ListHandle             lHandle);
  324.  
  325. EXTERN_API_C( void )
  326. lgetcelldatalocation            (short *                offset,
  327.                                  short *                len,
  328.                                  const Cell *            theCell,
  329.                                  ListHandle             lHandle);
  330.  
  331. EXTERN_API_C( void )
  332. lgetcell                        (void *                    dataPtr,
  333.                                  short *                dataLen,
  334.                                  const Cell *            theCell,
  335.                                  ListHandle             lHandle);
  336.  
  337. EXTERN_API_C( ListHandle )
  338. lnew                            (const Rect *            rView,
  339.                                  const ListBounds *        dataBounds,
  340.                                  Point *                cSize,
  341.                                  short                     theProc,
  342.                                  WindowPtr                 theWindow,
  343.                                  Boolean                 drawIt,
  344.                                  Boolean                 hasGrow,
  345.                                  Boolean                 scrollHoriz,
  346.                                  Boolean                 scrollVert);
  347.  
  348. EXTERN_API_C( void )
  349. lrect                            (Rect *                    cellRect,
  350.                                  const Cell *            theCell,
  351.                                  ListHandle             lHandle);
  352.  
  353. EXTERN_API_C( void )
  354. lsetcell                        (const void *            dataPtr,
  355.                                  short                     dataLen,
  356.                                  const Cell *            theCell,
  357.                                  ListHandle             lHandle);
  358.  
  359. EXTERN_API_C( void )
  360. lsetselect                        (Boolean                 setIt,
  361.                                  const Cell *            theCell,
  362.                                  ListHandle             lHandle);
  363.  
  364. EXTERN_API_C( void )
  365. ldraw                            (const Cell *            theCell,
  366.                                  ListHandle             lHandle);
  367.  
  368. EXTERN_API_C( Boolean )
  369. lclick                            (Point *                pt,
  370.                                  short                     modifiers,
  371.                                  ListHandle             lHandle);
  372.  
  373. EXTERN_API_C( void )
  374. lcellsize                        (Point *                cSize,
  375.                                  ListHandle             lHandle);
  376.  
  377. #endif  /* CGLUESUPPORTED */
  378.  
  379. #if OLDROUTINENAMES
  380. #define LDoDraw(drawIt, lHandle) LSetDrawingMode(drawIt, lHandle)
  381. #define LFind(offset, len, theCell, lHandle) LGetCellDataLocation(offset, len, theCell, lHandle)
  382. #if CGLUESUPPORTED
  383. #define lfind(offset, len, theCell, lHandle) lgetcelldatalocation(offset, len, theCell, lHandle)
  384. #endif  /* CGLUESUPPORTED */
  385.  
  386. #endif  /* OLDROUTINENAMES */
  387.  
  388.  
  389.  
  390. #if PRAGMA_STRUCT_ALIGN
  391.     #pragma options align=reset
  392. #elif PRAGMA_STRUCT_PACKPUSH
  393.     #pragma pack(pop)
  394. #elif PRAGMA_STRUCT_PACK
  395.     #pragma pack()
  396. #endif
  397.  
  398. #ifdef PRAGMA_IMPORT_OFF
  399. #pragma import off
  400. #elif PRAGMA_IMPORT
  401. #pragma import reset
  402. #endif
  403.  
  404. #ifdef __cplusplus
  405. }
  406. #endif
  407.  
  408. #endif /* __LISTS__ */
  409.  
  410.